<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.*,java.util.*,java.text.*" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="style.css">
<script language="JavaScript" type="text/javascript">
function doValidation() {
	 var summary = document.getElementById("summary").value;
	 var category = document.getElementById("category").value;
	 var device = document.getElementById("device").value;
	 var os = document.getElementById("os").value;
	 var priority = document.getElementById("priority").value;
	 var cust_name = document.getElementById("cust_name").value;
	 var email = document.getElementById("email").value;
	 var dept = document.getElementById("dept").value;
	 var office = document.getElementById("office").value;
	 var phone = document.getElementById("phone").value;
	 var desc = document.getElementById("desc").value;
	 if (summary==""||category == ""||device==""||os==""||priority==""||cust_name==""||email==""||dept==""||office==""||phone==""||desc=="")
		{
		alert("All fields are mandatory!! Please enter appropriately.");
		return false;
		}
	 return true;
}
</script>
<title>Help Desk Ticket</title>
</head>
<body>
<h2 align="center">Help Desk Ticket</h2>
<s:form action="add_ticket">
<%-- <% Date cur_date = new Date();
  SimpleDateFormat formatter = new SimpleDateFormat("DD/MM/YYYY");
  String date = formatter.format(cur_date);
 %>
<table id="text" align="center"></table><h5 align="right"><%=date%></h5></table> --%>
<table id="text" align="center">
<tr><td><s:textfield name="summary" label="Problem Summary" id="summary" size="50" /></td></tr>
<tr><td><s:select name="category" label="Problem Category" id="category" list="{'Hardware Problem', 'Software Problem'}" 
              headerKey="" headerValue="--Select a category--"/></td></tr>
<tr><td><s:textfield name="device" label="Which computer/device?" id="device" size="20" /></td></tr>
<tr><td><s:textfield name="os" label="Operating System" id="os" size="20" /></td></tr>
<tr><td><s:select name="priority" label="Priority Level" id="priority" list="{'Low', 'Important', 'Severe'}" 
              headerKey="" headerValue="--Select a level--"/></td></tr>
<tr><td><s:textfield name="cust_name" label="Customer Name" id="cust_name" size="20" /></td></tr>
<tr><td><s:textfield name="email" label="E-mail" id="email" size="30" readonly="true"/></td></tr>
<tr><td><s:textfield name="dept" label="Department" id="dept" size="20" /></td></tr>
<tr><td><s:textfield name="office" label="Office" id="office" size="20" /></td></tr>
<tr><td><s:textfield name="phone" label="Phone" id="phone" size="20" readonly="true" /></td></tr>
<tr><td><s:textarea name="desc" label="Problem Description" id="desc" /></td></tr>
<tr><td><s:submit name="submit" onClick="return doValidation()" /></td></tr>
</table>
</s:form>
</body>
</html>